#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Time    : 2021/7/16 14:00
# @Author  : Tina.du
# @File    : run_main.py
# @Project description：
from task.notice_task import lunch, dinner, mi_family, write_report
import datetime
import pytz

from apscheduler.schedulers.blocking import BlockingScheduler

run_time = datetime.datetime.now(pytz.timezone('PRC')).strftime("%Y-%m-%d %H:%M:%S")

scheduler = BlockingScheduler(timezone="Asia/Shanghai")
print("start...")

scheduler.add_job(lunch, 'cron', day_of_week='mon-fri', hour=11, minute=30, second=00)

scheduler.add_job(dinner, 'cron', day_of_week='mon-fri', hour=16, minute=30, second=00)

scheduler.add_job(mi_family, 'cron', day_of_week='tue', hour=9, minute=59, second=00)

scheduler.add_job(write_report, 'cron', day_of_week='fri', hour=18, minute=30, second=00)

try:
    scheduler.start()
except (KeyboardInterrupt, SystemExit):

    print("end...")
